<?php

if (is_ajax()):
	$post = array(
		'character' => $_POST['character'],
		'comment' => $_POST['comment'],
		'news_id' => $_POST['news_id']
	);
	if ($last_comment = $this->News->post_comment($post)):
		$json = array('success' => 1) + $last_comment;
		echo json_encode($json);
	else:
		echo json_encode(array('success' => 0, 'error' => $this->News->error));
	endif;
endif

?>